import junit.framework.TestCase;
import org.junit.Test;

public class ComplexTest extends TestCase {
    Complex a = new Complex(2, 1);
    Complex b = new Complex(1,2);
    Complex c = new Complex();
    @Test
    public void testjia() {
        c = a.ComplexAdd(b);
        assertEquals("3.0+3.0i", c.toString());
    }
    @Test
    public void testjian() {
        c = a.ComplexSub(b);
        assertEquals("1.0-1.0i", c.toString());
    }
    @Test
    public void testchu() {
        c = a.ComplexDiv(c);
        assertEquals("2.0+1.0i", c.toString());
        c = a.ComplexDiv(b);
        assertEquals("2.0+0.5i", c.toString());
    }
}